import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import error from '@dfeidao/atom-web/msgbox/error';
import direct_to from '@dfeidao/atom-web/url/direct-to';

export default async function a002(fd: IFeidaoAiBrowserComponent) {

	const usercode = get(fd, 'usercode') || '';
	if (usercode) {
		const res = await nodejs<{ code: number }>('common/zjc-000002/s001', { usercode });
		if (res.code === 1) {
			direct_to('./login.html');
		}
	} else {
		error('usercode为空!');
	}
}
